GalleryView

open class GalleryView : RelativeLayout, RevelControl, DownloadFeedTask2.OnCompleted, DownloadImageTask2.OnCompleted, QueryVideoInfosTask.OnCompleted, DownloadFileTask2.OnCompleted, PlaceExchangeAdRequestTask.OnCompleted, OnCommandListener, VistarAdRequestTask.OnCompleted, PlayedHandler

A custom RelativeLayout that displays a gallery of different types of media, including images, videos, and web content.

The GalleryView is responsible for managing a playlist of media sources defined by a com.reveldigital.player.api.Module. It handles the loading, display, and transitioning between these sources. It supports various content types such as local files, remote URLs, RSS feeds, YouTube videos, and content from ad platforms like Place Exchange and Vistar Media.

Key functionalities include:

  • Inflating appropriate layouts based on device capabilities and preferences (e.g., SurfaceView vs. TextureView, ExoPlayer).
  • Managing playback state (start, stop, pause, next, previous).
  • Handling transitions between media items (e.g., fade animations).
  • Downloading and caching media content.
  • Interacting with web content via a Javascript interface.
  • Listening to and dispatching playback events (e.g., item played, playlist completed).
  • Integrating with external ad services for dynamic ad insertion.
  • Responding to commands (e.g., from a remote control or server).

This view implements various listener interfaces to react to asynchronous operations like downloads and ad requests, and RevelControl to provide a standardized interface for controlling media playback.

See also

Constructors

Link copied to clipboard
constructor(context: Context, attrs: AttributeSet)
Constructor for inflating the view from XML.
constructor(context: Context, attrs: AttributeSet, defStyle: Int)
Constructor for inflating the view from XML with a default style.
constructor(context: Context, module: Module)
Programmatic constructor for creating a GalleryView instance.

Properties

Link copied to clipboard
open val isStarted: Boolean
Link copied to clipboard

Functions

Link copied to clipboard
Adds an OnCallbackListener to the list of listeners that will be notified of callback events.
Link copied to clipboard
Registers a `PlaylistListener` to receive notifications about playlist events.
Link copied to clipboard
open fun dispose()
Releases any resources held by this control and prepares it for removal or permanent deactivation.
Link copied to clipboard
open fun getName(): String
Gets the unique name assigned to this control.
Link copied to clipboard
open fun getOptions(): Iterator<out Option>
Gets an iterator over the configuration s for this control.
Link copied to clipboard
open fun getPlaylist(): Playlist
Gets the associated with this control, if any.
Link copied to clipboard
open fun getSource(): Source
Gets the current source from the playlist.
Link copied to clipboard
open fun getType(): ModuleType
Gets the type of the underlying module or content associated with this control.
Link copied to clipboard
open fun getVideoView(): VideoViewImpl
Gets the current VideoViewImpl used by this presenter.
Link copied to clipboard
open fun getZIndex(): Int
Gets the Z-index (stacking order) of this control.
Link copied to clipboard
open fun initialize(module: Module)
Initializes the control with its associated module context.
Link copied to clipboard
open fun isAutoStart(): Boolean
Checks if this control is configured to start its operation automatically after #initialize(Module) initialization.
Link copied to clipboard
open fun next()
Moves to the next media source in the playlist.
Link copied to clipboard
open fun onAdRequestCompleted(response: AdResponse, sourceId: String)
Link copied to clipboard
open fun onCommand(name: String, value: String)
Invoked when a command is received by a component this listener is registered with.
Link copied to clipboard
open fun onDownloadFeedCompleted(feed: Feed)
Link copied to clipboard
open fun onDownloadFileCompleted(file: File)
Link copied to clipboard
open fun onDownloadImageCompleted(view: ImageView, bitmap: Bitmap)
Link copied to clipboard
open fun onQueryAdRequestCompleted(response: AdRequestResponse)
Link copied to clipboard
open fun onQueryVideoInfosCompleted(videoInfos: List<VideoInfo>, source: Source)
Link copied to clipboard
open fun pause()
Pause the video playback.
Link copied to clipboard
open fun previous()
Move to the previous source in the playlist.
Link copied to clipboard
open fun registerPlayedListener(listener: PlayedListener)
Registers a listener to be notified when a played event occurs.
Link copied to clipboard
Removes an OnCallbackListener from the list of listeners that are notified when an event occurs.
Link copied to clipboard
Removes a playlist listener that was previously added with addPlaylistListener.
Link copied to clipboard
open fun resume()
Resumes video playback if it was previously paused.
Link copied to clipboard
open fun seekTo(position: Int)
Seeks to the specified position in the video.
Link copied to clipboard
open fun setAutoStart(flag: Boolean)
Sets whether this control should start its operation automatically after #initialize(Module) initialization.
Link copied to clipboard
open fun setLooping(flag: Boolean)
Sets whether the video should loop seamlessly.
Link copied to clipboard
open fun setSource(source: Source)
Sets and plays the specified Source in the playlist.
open fun setSource(idx: Int)
Sets and plays the source specified by playlist index (0 based).
open fun setSource(source: Source, play: Boolean)
Sets the current source.
open fun setSource(idx: Int, play: Boolean)
Set the source by index (0 based).
Link copied to clipboard
open fun setVolume(volume: Float)
Sets the volume for audio/video sources.
Link copied to clipboard
open fun start()
Starts or resumes the active operation of this control.
Link copied to clipboard
open fun startAt(source: Source)
Starts playing at the specified Source.
open fun startAt(idx: Int)
Starts playing at the specified playlist index.
Link copied to clipboard
open fun stop()
Stops or pauses the active operation of this control.